package edu.mobbuzz.daf.bean;

import java.io.Serializable;

public class Subscriber extends BaseBean implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String id;
	private String username;
	private String url;
	
	private Rss rss;
	private User user;
	
	public Subscriber(String id, String username, String url) {
		this.id = id;
		this.username = username;
		this.url = url;
	}
	
	public Subscriber() {
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	public String getUsername() {
		username = getUser().getUsername();
		return username;
	}
	
	public void setUsername(String username) {
		this.username = username;
		getUser().setUsername(username);
	}

	public String getUrl() {
		url = getRss().getUrl();
		return url;
	}
	
	public void setUrl(String url) {
		this.url = url;
		getRss().setUrl(url);
	}
	

	public Rss getRss() {
		if(rss==null)
			rss = new Rss();
		return rss;
	}

	public void setRss(Rss rss) {
		this.rss = rss;
	}

	public User getUser() {
		if(user==null)
			user = new User();
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
	@Override
	protected String getPrimaryKey() {
		return getId();
	}
}
